package smartcommunityserver.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import smartcommunityserver.bean.BaseCount_3_Bean;

import java.util.List;

@Mapper
public interface BaseCount_3_Mapper {
    @Select("SELECT\n" +
            "  '处理中退款金额' as name ,\n" +
            "  round(processing_refund_amount/(processing_refund_amount+total_estimated_recoverable_amount),2) as numbl\n" +
            "\n" +
            "FROM refund_insights.refund_two\n" +
            "WHERE window_start = '2025-09-07 00:00:00'\n" +
            "GROUP BY name ,numbl\n" +
            "UNION ALL\n" +
            "SELECT\n" +
            "    '预计可挽回金额' as name ,\n" +
            "    round(total_estimated_recoverable_amount/(processing_refund_amount+total_estimated_recoverable_amount),2) as numbl\n" +
            "FROM refund_insights.refund_two\n" +
            "WHERE window_start = '2025-09-07 00:00:00'\n" +
            "GROUP BY name ,numbl")
    List<BaseCount_3_Bean> baseCountMapper3();
}
